package com.yunxi.service.dubboService.impl.otd;

import com.yunxi.core.web.ApiResult;
import com.yunxi.otd.service.OtdRuleBaseDubboService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import java.lang.reflect.InvocationTargetException;
import com.yunxi.otd.pojo.OtdRuleBaseVO;
import java.util.Map;
import java.util.List;
import org.springframework.beans.BeanUtils;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.github.pagehelper.PageInfo;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yunxi.service.localService.otd.OtdRuleBaseService;
import com.yunxi.model.otd.OtdRuleBase;

/**
 * <p>
 * 生产规则库 服务实现类
 * </p>
 *
 * @author XUQI
 * @since 2019-10-09
 */
public class OtdRuleBaseDubboServiceImpl implements OtdRuleBaseDubboService {

    @Autowired
    @Qualifier(value = "otdRuleBaseServiceImpl")
    OtdRuleBaseService otdRuleBaseService;


    @Override
    public OtdRuleBaseVO getById(String id) throws InvocationTargetException, IllegalAccessException {
        OtdRuleBase otdRuleBase = otdRuleBaseService.getById(id);
        OtdRuleBaseVO otdRuleBaseVO = new OtdRuleBaseVO();
        BeanUtils.copyProperties(otdRuleBase, otdRuleBaseVO);
        return otdRuleBaseVO;
    }

    @Override
    public ApiResult saveOrUpdate(OtdRuleBaseVO otdRuleBaseVO)  {
        return otdRuleBaseService.saveOrUpdate(otdRuleBaseVO);
    }

    @Override
    public PageInfo<OtdRuleBaseVO> findPageByVO(OtdRuleBaseVO otdRuleBaseVO, Integer pageNum, Integer pageSize)
        throws InvocationTargetException, IllegalAccessException {
        PageInfo<OtdRuleBaseVO> pageInfo = otdRuleBaseService.pageByVo(otdRuleBaseVO, pageNum, pageSize);
        return pageInfo;
    }

    @Override
    public void removeByListVo(List<OtdRuleBaseVO> otdRuleBaseVOList)
        throws IllegalAccessException, InvocationTargetException, InstantiationException {
        otdRuleBaseService.removeByListVo(otdRuleBaseVOList);
    }

    @Override
    public List listByVo(OtdRuleBaseVO otdRuleBaseVO) {
        return otdRuleBaseService.listByVo(otdRuleBaseVO);
    }
}
